package com.ezhuan.common.controller;

import com.ezhuan.common.util.DateFormatUtil;
import com.ezhuan.common.util.EncryptUtil;
import com.ezhuan.common.util.PageInfoUtil;
import com.ezhuan.common.util.RegexUtil;
import com.ezhuan.common.util.SmsUtil;
import com.jfinal.core.Controller;

/**
 * 所有父类的Controller
 * @author wangshSxt
 *
 */
public class BaseController extends Controller
{
	/* 加密工具类 */
	protected EncryptUtil encryptUtil = new EncryptUtil() ; 
	protected SmsUtil smsUtil = new SmsUtil(); 
	protected RegexUtil regexUtil = new RegexUtil();
	protected DateFormatUtil dateFormatUtil = new DateFormatUtil();
	
	/**
	 * 生成分页的工具类
	 * @param request
	 * @return
	 */
	protected PageInfoUtil proccedPageInfoUtil()
	{
		String currentPage = this.getPara("currentPage");
		String pageSize = this.getPara("pageSize");
		/* 设置分页信息 */
		PageInfoUtil pageInfoUtil = new PageInfoUtil();
		try
		{
			pageInfoUtil.setPageSize(Integer.valueOf(pageSize));
			pageInfoUtil.setCurrentPage(Integer.valueOf(currentPage));
		} catch (Exception e)
		{
		}
		return pageInfoUtil ; 
	}
}
